<?php
/**
 * The Template for displaying all single posts.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

get_header(); ?>

		<div id="primary">
			<div id="content" role="main"><div>
				
				<?php while ( have_posts() ) : the_post(); 
					// `get primary meta content
                    $post_id = get_the_ID();
                    $parent_id = get_post_meta($post_id, '_wpcf_belongs_tutorials_id', true);
                    $parent_link = get_permalink($parent_id);
                    $parent_title = get_the_title($parent_id);
                    ?>
                    <a href="<?php echo $parent_link; ?>" class="item-parent-backlink"><?php echo $parent_title; ?></a>
					<h1><?php the_title();?></h1>
					<?php edit_post_link();?>
	                <div class="post-body item-body" data="<?php echo $post_id; ?>">
	                	<div class="item-description">
	                		<?php the_content(); ?>
	                	</div>
	                </div>
		           	<?php comments_template( '', true ); ?>
					

				<?php endwhile; // end of the loop. ?>

			</div></div><!-- #content -->			
			<?php get_sidebar(); ?>
		</div><!-- #primary -->
		<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/single.js"></script>
<?php get_footer(); ?>